<?php
?>
<div>
<div id='product_show_slider'>
	<div class='slider1'></div>
	<div class='slider2'>
		<div class='txt'>产 品 展 示 &nbsp&nbsp&nbsp PRODUCTS SHOW</div>
	</div>
	<div class='slider3'>
		<div class='txt'>
			<a href='<?php echo JRoute::_('index.php?option=com_products&view=products');?>'>>>更多
			</a>
		</div>
	</div>
</div>
<table cellpadding="0" cellspacing="0" bgcolor="#ffffff" id='table_slider'>
	<tr>
		<td><a href="javascript:void(0);" id="LeftButton2"><div class='sliver_left'></div></a></td>
		<td width="10"></td>
		<td valign="top" width="450" height='320'>
			<div ID="MarqueeDiv2" style="width:477px;overflow:hidden;"><TABLE style="WIDTH:800px; BORDER-COLLAPSE: collapse;display:inline;" cellSpacing=0 cellPadding=0 align=center border=0>
				<TBODY>
				<TR>
				<?php 
				$total=count($list);
				if ($total<18){
					//推荐产品小于18种则重复推荐
					$repeat_num=18-$total;
				}
				for ($i=0;$i<$total;$i++){
					$val=$list[$i];				
						$product_url=JRoute::_('index.php?option=com_products&view=product&layout=view&id='.$val[0]);				
				?>
					<TD width="160" align="center" style='padding:4px;'>
						<div style='height:140px;width:160px;'>
							<div style='width=160px;height:120px;background:url(<?php echo COM_MEDIA_BASEURL.$val[2];?>) no-repeat;border:1px solid #F0F0F0;v-align:center;'>							
							</div>
							<A href="<?php echo $product_url;?>" title='点击查看产品详情'><?php echo $val[1];?></A> 
						</div>
						<br/>
				<?php 
					$i++;
					$val=$list[$i];	
					if (!$val){
						$val=$list[0];
					}
				?>
						<div style='height:130px;width:160px;'>
							<div style='width=120px;height:120px;background:url(<?php echo COM_MEDIA_BASEURL.$val[2];?>) no-repeat;border:1px solid #F0F0F0;v-align:center;'>							
							</div>
							<A href="<?php echo $product_url;?>" title='点击查看产品详情'><?php echo $val[1];?></A> 
						</div>
						
					</TD>
				<?php 		
					//}
				}
				?>		
				</TR>
				</TBODY>
				</TABLE></div>
		</td>
		<td width="10"></td>
		<td><a href="javascript:void(0);" id="RightButton2"><div class='sliver_right'></div></a></td>
	</tr>
</table>
<script type="text/javascript">
	/*********箭头控制滚动方向、加速及鼠标拖动***************/
	var MarqueeDiv2Control=new Marquee("MarqueeDiv2");		//箭头控制滚动方向、加速及鼠标拖动实例
	MarqueeDiv2Control.Direction="left";
	MarqueeDiv2Control.Step=1;
	MarqueeDiv2Control.Width=635;
	MarqueeDiv2Control.Height=320;
	MarqueeDiv2Control.Timer=20;
	MarqueeDiv2Control.ScrollStep=1;				//若为-1则禁止鼠标控制实例
	MarqueeDiv2Control.Start();
	//$("#LeftButton2").onmouseover=function(){MarqueeDiv2Control.Direction=2};
	//$("#LeftButton2").onmouseout=$("#LeftButton2").onmouseup=function(){MarqueeDiv2Control.Step=MarqueeDiv2Control.BakStep};
	$("#LeftButton2").onmousedown=$("#RightButton2").onmousedown=function(){MarqueeDiv2Control.Step=MarqueeDiv2Control.BakStep+3};
	$("#RightButton2").onmouseover=function(){MarqueeDiv2Control.Direction=3};
	$("#RightButton2").onmouseout=$("#RightButton2").onmouseup=function(){MarqueeDiv2Control.Step=MarqueeDiv2Control.BakStep};
	document.getElementById("LeftButton2").onmouseover=function(){MarqueeDiv2Control.Direction=2};
	document.getElementById("LeftButton2").onmouseout=document.getElementById("LeftButton2").onmouseup=function(){MarqueeDiv2Control.Step=MarqueeDiv2Control.BakStep};
	document.getElementById("LeftButton2").onmousedown=document.getElementById("RightButton2").onmousedown=function(){MarqueeDiv2Control.Step=MarqueeDiv2Control.BakStep+3};
	document.getElementById("RightButton2").onmouseover=function(){MarqueeDiv2Control.Direction=3};
	document.getElementById("RightButton2").onmouseout=document.getElementById("RightButton2").onmouseup=function(){MarqueeDiv2Control.Step=MarqueeDiv2Control.BakStep};
	
</script>
</div>